FROM tomcat:8.5.64-jdk8-corretto
ENV TZ=Asia/Shanghai
RUN ln -sf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
RUN yum install -y zip unzip
#将webapp下的全部删除
RUN rm -rf /usr/local/tomcat/webapps/*
#将target下的xx.war拷贝到/usr/local/tomcat/webapps/下
ADD ./api/target/api.war /usr/local/tomcat/webapps/

RUN cd /usr/local/tomcat/webapps/ && unzip api.war -d ROOT && rm -rf api.war
#端口
EXPOSE 8080

#设置启动命令
ENTRYPOINT ["/usr/local/tomcat/bin/catalina.sh","run"]